package datasv.collegeQuery_datasv;

import data.datafactory.DatabaseOperator;
import resultmessage.CollegeQueryRM;

public class DeleteCollegeConsular {
	public static void main(String[] args) {
		System.out.println(new DeleteCollegeConsular().deleteCollegeConsular("001", "001133001"));
	}
	public CollegeQueryRM deleteCollegeConsular(String collegeID,String consularID){
		return deleteInSql(collegeID, consularID);
	}
	private CollegeQueryRM deleteInSql(String collegeID,String consularID){
		DatabaseOperator op=new DatabaseOperator("college"+collegeID);
		if(!op.ifDatabaseExist()){
			return CollegeQueryRM.COLLEGE_NOT_EXIT;
		}
		if(op.deleteOneRow(consularID, "consular_list")){
			return CollegeQueryRM.SUCCESS;
		}
		return CollegeQueryRM.COLLEGECONSULAR_NOT_EXIT;
	}
}
